add gaussian square echo pulse#9370
Conversation
|
|
|
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
There was a problem hiding this comment.
Hi @miamico ,
Looks like an interesting addition. While not strictly causing any breakdowns right now, the use of ScalableSymbolicPulse goes against the definition of the class - and might cause problems down the road.
I think there are two options here:
- Use a general purpose
SymbolicPulseinstead ofScalableSymbolicPulse. - Force the envelope form of
ScalableSymbolicPulseon your envelope.
The latter could be done by defining rel_active_amp instead of active_amp and defining the total envelope as: amp*(envelope_expr + rel_active_amp*envelope_expr_xy) (where amp and active_amp are removed from the original expressions).
@nkanazawa1989 could help out here.
|
@miamico You also need to add release notes - check out here, and draw inspiration from @wshanks PR #9329 . It will also be healthy to add some tests to make sure this pulse functions as expected (Doing this would have caught the incorrect instantiation we had, for example). Check out this test and maybe add to the QPY test here. |
Pull Request Test Coverage Report for Build 4823142933
💛 - Coveralls |
There was a problem hiding this comment.
Thanks @miamico this looks almost good to go. IIRC you are doing this because some deployed devices will report DCX pulse in this form. To let them use parametric form, you need to register this pulse name to this enum.
https://github.com/Qiskit/qiskit-terra/blob/d814ad43c81e2b285ea91db4f4bba2234bc2b7db/qiskit/qobj/converters/pulse_instruction.py#L41-L46
Also could you please add unittest in this class?
https://github.com/Qiskit/qiskit-terra/blob/d814ad43c81e2b285ea91db4f4bba2234bc2b7db/test/python/pulse/test_pulse_lib.py#L122
You can find several tests with GaussianSquareDrag for example.
I will approve and merge this PR with these updates.
|
This PR fails in the docs build. See the following Sphinx guide for the literal block formatting. (the error message is not really friendly) |
wshanks
left a comment
There was a problem hiding this comment.
Here is some feedback on the doc string. Otherwise this PR looks good to me (except maybe the suggestion to rename amp and angle).
| docstring for more details. | ||
| width: The duration of the embedded square pulse. | ||
| angle: The angle in radians of the complex phase factor uniformly | ||
| scaling the pulse. Default value 0. |
There was a problem hiding this comment.
It needs to be clarified that this angle affects only the echoed part of the pulse, not the entire pulse. I would change to amp and angle to echo_amp and echo_angle to put the two parts on equal footing, but I don't feel too strongly about it.
There was a problem hiding this comment.
I have tried to be more specific in the docstring on what refers to what. I'd like to avoid changing variable names as amp and angle are the standard variable names used for other pulses (and one could define a GaussianSquareEcho just by defining these two).
|
All checks are passing now |
wshanks
left a comment
There was a problem hiding this comment.
This looks good to me now. I just had one suggestion.
Co-authored-by: Will Shanks <wshaos@posteo.net>
wshanks
left a comment
There was a problem hiding this comment.
This looks good to me, but I will leave it to @TsafrirA and @nkanazawa1989 to approve and merge!
|
great! thanks :) |
|
@miamico Sorry about this extra work, but we decided to move forward with the deprecation of the symbolic pulse classes (which are in pending status now) in favor of functions. Could you change all of the |
wshanks
left a comment
There was a problem hiding this comment.
I found two tiny things to change. If those look right to you, we can merge.
Co-authored-by: Will Shanks <wshaos@posteo.net>
….yaml Co-authored-by: Will Shanks <wshaos@posteo.net>
Yes totally! I've committed those suggestions :) |
nkanazawa1989
left a comment
There was a problem hiding this comment.
Thanks. This looks good to go. I'll add this to merge queue.
* add gaussian square echo pulse * address some PR comments * fixed parameters of symbolicpulse * adding math description and reference * change variable names * fix lint * remove width_echo parameter * fix lint * add release notes * fix conflicts * address some PR comments * fixed parameters of symbolicpulse * adding math description and reference * change variable names * fix lint * remove width_echo parameter * fix lint * add release notes * Update first paragraph Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Update amp param to float Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Update angle def param to float Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * Update amp constrain Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> * drafting tests * update docstring * finish up test * fix missing pulses from init * addding Cos * missing sin * fixed tests * black formatting * break string * fixing strings * reformatting * fix lint * fixing last things * fix tests * fix black * fix another test * fix amp validation * fixing docstring * Update qiskit/pulse/library/symbolic_pulses.py Co-authored-by: Will Shanks <wshaos@posteo.net> * rename to gaussian_square_echo * fix lint * Update qiskit/qobj/converters/pulse_instruction.py Co-authored-by: Will Shanks <wshaos@posteo.net> * Update releasenotes/notes/gaussian-square-echo-pulse-84306f1a02e2bb28.yaml Co-authored-by: Will Shanks <wshaos@posteo.net> --------- Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com> Co-authored-by: Will Shanks <wshaos@posteo.net>

Summary
Add
GaussianSquareEchosymbolic pulse. Similarly to what was done in #9329Details and comments
The
GaussianSquareEchopulse is comprised of two tones driving the target qubit during the cross-resonance gate. The echoed pulse is a rotary tone while the Gaussian square pulse overlaid on it is a cancellation tone. The pulse shape was introduced in this paper and an example visualization can be found at the bottom panel of figure 7a of this paper (the red and orange curve of the DCX plot).Open to suggestions for which tests to come up for it.